#!/usr/bin/python 
# -*- coding: utf-8 -*-
import  random;

def fun_max(v_num1,v_num2):
    if v_num1 > v_num2:
        return v_num1
    elif v_num1 < v_num2:
        return v_num2
    else:
        return  v_num1

def fun_min(v_num1,v_num2):
    if v_num1 > v_num2:
        return v_num2
    elif v_num1 < v_num2:
        return v_num1
    else:
        return  v_num1


def fun_filter(v_list):
    num_len=len(v_list)
    value_max = 0
    value_min = 0

    for i in range(0,num_len):
        value_max = fun_max(value_max, v_list[i])
        value_min = fun_min(value_min, v_list[i])
    print(value_max,value_min)
    return value_max,value_min




v_list =[]
for i in range(0,50):
    m = random.randrange(0,50)
    v_list.append(m)

max_list,min_list = fun_filter(v_list)
print ('列表如下：' ,v_list)
print ('max value: %d , min value:%d' %(max_list,min_list))







